﻿using UnityEngine;
using System.Collections;

public class DebugManager : MonoBehaviour {
	
	public int lineCount = 6;
	
	private ArrayList debugText = new ArrayList();
	
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		
		int count = debugText.Count;
		int offset = 0;
		if(debugText.Count > lineCount)
		{
			count = lineCount;
			offset = debugText.Count - lineCount;
		}
		
		for(int i=0; i<count; i++)
		{
			GameObject text = GameObject.Find("Text"+(i+1));
			text.guiText.text = debugText[i + offset] as string;
		}
	}
	
	public void AddText(string text)
	{
		debugText.Add(text);
	}
}
